<!doctype html>
<script src="../../../resources/testharness.js"></script>
<script src="../../../resources/testharnessreport.js"></script>
<script src="../../assert_selection.js"></script>
<script>
selection_test(
  '<div contenteditable dir="rtl">|Lorem <span dir="rtl">ipsum dolor sit</span> amet</div>',
  selection => selection.modify('extend', 'forward', 'lineboundary'),
  '<div contenteditable dir="rtl">^Lorem <span dir="rtl">ipsum dolor sit</span> amet|</div>',
  '2-0 rtl forward lineboundary');

selection_test(
  '<div contenteditable dir="rtl">L|orem <span dir="rtl">ipsum dolor sit</span> amet</div>',
  selection => selection.modify('extend', 'forward', 'lineboundary'),
  '<div contenteditable dir="rtl">L^orem <span dir="rtl">ipsum dolor sit</span> amet|</div>',
  '2-1 rtl forward lineboundary');

selection_test(
  '<div contenteditable dir="rtl">Lo|rem <span dir="rtl">ipsum dolor sit</span> amet</div>',
  selection => selection.modify('extend', 'forward', 'lineboundary'),
  '<div contenteditable dir="rtl">Lo^rem <span dir="rtl">ipsum dolor sit</span> amet|</div>',
  '2-2 rtl forward lineboundary');

selection_test(
  '<div contenteditable dir="rtl">Lor|em <span dir="rtl">ipsum dolor sit</span> amet</div>',
  selection => selection.modify('extend', 'forward', 'lineboundary'),
  '<div contenteditable dir="rtl">Lor^em <span dir="rtl">ipsum dolor sit</span> amet|</div>',
  '2-3 rtl forward lineboundary');

selection_test(
  '<div contenteditable dir="rtl">Lore|m <span dir="rtl">ipsum dolor sit</span> amet</div>',
  selection => selection.modify('extend', 'forward', 'lineboundary'),
  '<div contenteditable dir="rtl">Lore^m <span dir="rtl">ipsum dolor sit</span> amet|</div>',
  '2-4 rtl forward lineboundary');

selection_test(
  '<div contenteditable dir="rtl">Lorem| <span dir="rtl">ipsum dolor sit</span> amet</div>',
  selection => selection.modify('extend', 'forward', 'lineboundary'),
  '<div contenteditable dir="rtl">Lorem^ <span dir="rtl">ipsum dolor sit</span> amet|</div>',
  '2-5 rtl forward lineboundary');

selection_test(
  '<div contenteditable dir="rtl">Lorem <span dir="rtl">|ipsum dolor sit</span> amet</div>',
  selection => selection.modify('extend', 'forward', 'lineboundary'),
  '<div contenteditable dir="rtl">Lorem <span dir="rtl">^ipsum dolor sit</span> amet|</div>',
  '2-6 rtl forward lineboundary');

selection_test(
  '<div contenteditable dir="rtl">Lorem <span dir="rtl">i|psum dolor sit</span> amet</div>',
  selection => selection.modify('extend', 'forward', 'lineboundary'),
  '<div contenteditable dir="rtl">Lorem <span dir="rtl">i^psum dolor sit</span> amet|</div>',
  '2-7 rtl forward lineboundary');

selection_test(
  '<div contenteditable dir="rtl">Lorem <span dir="rtl">ip|sum dolor sit</span> amet</div>',
  selection => selection.modify('extend', 'forward', 'lineboundary'),
  '<div contenteditable dir="rtl">Lorem <span dir="rtl">ip^sum dolor sit</span> amet|</div>',
  '2-8 rtl forward lineboundary');

selection_test(
  '<div contenteditable dir="rtl">Lorem <span dir="rtl">ips|um dolor sit</span> amet</div>',
  selection => selection.modify('extend', 'forward', 'lineboundary'),
  '<div contenteditable dir="rtl">Lorem <span dir="rtl">ips^um dolor sit</span> amet|</div>',
  '2-9 rtl forward lineboundary');

selection_test(
  '<div contenteditable dir="rtl">Lorem <span dir="rtl">ipsu|m dolor sit</span> amet</div>',
  selection => selection.modify('extend', 'forward', 'lineboundary'),
  '<div contenteditable dir="rtl">Lorem <span dir="rtl">ipsu^m dolor sit</span> amet|</div>',
  '2-10 rtl forward lineboundary');

selection_test(
  '<div contenteditable dir="rtl">Lorem <span dir="rtl">ipsum| dolor sit</span> amet</div>',
  selection => selection.modify('extend', 'forward', 'lineboundary'),
  '<div contenteditable dir="rtl">Lorem <span dir="rtl">ipsum^ dolor sit</span> amet|</div>',
  '2-11 rtl forward lineboundary');

selection_test(
  '<div contenteditable dir="rtl">Lorem <span dir="rtl">ipsum |dolor sit</span> amet</div>',
  selection => selection.modify('extend', 'forward', 'lineboundary'),
  '<div contenteditable dir="rtl">Lorem <span dir="rtl">ipsum ^dolor sit</span> amet|</div>',
  '2-12 rtl forward lineboundary');

selection_test(
  '<div contenteditable dir="rtl">Lorem <span dir="rtl">ipsum d|olor sit</span> amet</div>',
  selection => selection.modify('extend', 'forward', 'lineboundary'),
  '<div contenteditable dir="rtl">Lorem <span dir="rtl">ipsum d^olor sit</span> amet|</div>',
  '2-13 rtl forward lineboundary');

selection_test(
  '<div contenteditable dir="rtl">Lorem <span dir="rtl">ipsum do|lor sit</span> amet</div>',
  selection => selection.modify('extend', 'forward', 'lineboundary'),
  '<div contenteditable dir="rtl">Lorem <span dir="rtl">ipsum do^lor sit</span> amet|</div>',
  '2-14 rtl forward lineboundary');

selection_test(
  '<div contenteditable dir="rtl">Lorem <span dir="rtl">ipsum dol|or sit</span> amet</div>',
  selection => selection.modify('extend', 'forward', 'lineboundary'),
  '<div contenteditable dir="rtl">Lorem <span dir="rtl">ipsum dol^or sit</span> amet|</div>',
  '2-15 rtl forward lineboundary');

selection_test(
  '<div contenteditable dir="rtl">Lorem <span dir="rtl">ipsum dolo|r sit</span> amet</div>',
  selection => selection.modify('extend', 'forward', 'lineboundary'),
  '<div contenteditable dir="rtl">Lorem <span dir="rtl">ipsum dolo^r sit</span> amet|</div>',
  '2-16 rtl forward lineboundary');

selection_test(
  '<div contenteditable dir="rtl">Lorem <span dir="rtl">ipsum dolor| sit</span> amet</div>',
  selection => selection.modify('extend', 'forward', 'lineboundary'),
  '<div contenteditable dir="rtl">Lorem <span dir="rtl">ipsum dolor^ sit</span> amet|</div>',
  '2-17 rtl forward lineboundary');

selection_test(
  '<div contenteditable dir="rtl">Lorem <span dir="rtl">ipsum dolor |sit</span> amet</div>',
  selection => selection.modify('extend', 'forward', 'lineboundary'),
  '<div contenteditable dir="rtl">Lorem <span dir="rtl">ipsum dolor ^sit</span> amet|</div>',
  '2-18 rtl forward lineboundary');

selection_test(
  '<div contenteditable dir="rtl">Lorem <span dir="rtl">ipsum dolor s|it</span> amet</div>',
  selection => selection.modify('extend', 'forward', 'lineboundary'),
  '<div contenteditable dir="rtl">Lorem <span dir="rtl">ipsum dolor s^it</span> amet|</div>',
  '2-19 rtl forward lineboundary');

selection_test(
  '<div contenteditable dir="rtl">Lorem <span dir="rtl">ipsum dolor si|t</span> amet</div>',
  selection => selection.modify('extend', 'forward', 'lineboundary'),
  '<div contenteditable dir="rtl">Lorem <span dir="rtl">ipsum dolor si^t</span> amet|</div>',
  '2-20 rtl forward lineboundary');

selection_test(
  '<div contenteditable dir="rtl">Lorem <span dir="rtl">ipsum dolor sit</span>| amet</div>',
  selection => selection.modify('extend', 'forward', 'lineboundary'),
  '<div contenteditable dir="rtl">Lorem <span dir="rtl">ipsum dolor sit</span>^ amet|</div>',
  '2-21 rtl forward lineboundary');

selection_test(
  '<div contenteditable dir="rtl">Lorem <span dir="rtl">ipsum dolor sit</span> |amet</div>',
  selection => selection.modify('extend', 'forward', 'lineboundary'),
  '<div contenteditable dir="rtl">Lorem <span dir="rtl">ipsum dolor sit</span> ^amet|</div>',
  '2-22 rtl forward lineboundary');

selection_test(
  '<div contenteditable dir="rtl">Lorem <span dir="rtl">ipsum dolor sit</span> a|met</div>',
  selection => selection.modify('extend', 'forward', 'lineboundary'),
  '<div contenteditable dir="rtl">Lorem <span dir="rtl">ipsum dolor sit</span> a^met|</div>',
  '2-23 rtl forward lineboundary');

selection_test(
  '<div contenteditable dir="rtl">Lorem <span dir="rtl">ipsum dolor sit</span> am|et</div>',
  selection => selection.modify('extend', 'forward', 'lineboundary'),
  '<div contenteditable dir="rtl">Lorem <span dir="rtl">ipsum dolor sit</span> am^et|</div>',
  '2-24 rtl forward lineboundary');

selection_test(
  '<div contenteditable dir="rtl">Lorem <span dir="rtl">ipsum dolor sit</span> ame|t</div>',
  selection => selection.modify('extend', 'forward', 'lineboundary'),
  '<div contenteditable dir="rtl">Lorem <span dir="rtl">ipsum dolor sit</span> ame^t|</div>',
  '2-25 rtl forward lineboundary');

selection_test(
  '<div contenteditable dir="rtl">Lorem <span dir="rtl">ipsum dolor sit</span> amet|</div>',
  selection => selection.modify('extend', 'forward', 'lineboundary'),
  '<div contenteditable dir="rtl">Lorem <span dir="rtl">ipsum dolor sit</span> amet|</div>',
  '2-26 rtl forward lineboundary');
</script>
